FGA_BASE: adding base types and module registraiton#556
FGA_BASE: adding base types and module registraiton#556swaroopAkkineniWorkos wants to merge 4 commits intomainfrom
Conversation
|
@greptile review |
Greptile SummaryThis PR adds foundational types and HTTP infrastructure for the new Fine-Grained Authorization (FGA) module:
The implementation is clean, symmetric across sync/async, and consistent with existing SDK conventions. The Confidence Score: 4/5
Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class WorkOSModel {
+dict()
}
class AccessEvaluation {
+bool authorized
}
class Resource {
+Literal object
+str id
+str external_id
+str name
+Optional~str~ description
+str resource_type_slug
+str organization_id
+Optional~str~ parent_resource_id
+str created_at
+str updated_at
}
class RoleAssignment {
+Literal object
+str id
+RoleAssignmentRole role
+RoleAssignmentResource resource
+str created_at
+str updated_at
}
class RoleAssignmentRole {
+str slug
}
class RoleAssignmentResource {
+str id
+str external_id
+str resource_type_slug
}
class AuthorizationOrganizationMembership {
+Literal object
+str id
+str user_id
+str organization_id
+str organization_name
+LiteralOrUntyped status
+Optional~Mapping~ custom_attributes
+str created_at
+str updated_at
}
class BaseHTTPClient {
+_prepare_request(force_include_body)
}
class SyncHTTPClient {
+request()
+delete_with_body()
}
class AsyncHTTPClient {
+request()
+delete_with_body()
}
WorkOSModel <|-- AccessEvaluation
WorkOSModel <|-- Resource
WorkOSModel <|-- RoleAssignment
WorkOSModel <|-- RoleAssignmentRole
WorkOSModel <|-- RoleAssignmentResource
WorkOSModel <|-- AuthorizationOrganizationMembership
RoleAssignment *-- RoleAssignmentRole
RoleAssignment *-- RoleAssignmentResource
BaseHTTPClient <|-- SyncHTTPClient
BaseHTTPClient <|-- AsyncHTTPClient
Last reviewed commit: 526eb7d |
| from workos.types.workos_model import WorkOSModel | ||
| from workos.typing.literals import LiteralOrUntyped | ||
|
|
||
| OrganizationMembershipStatus = Literal["active", "inactive", "pending"] |
There was a problem hiding this comment.
Duplicated OrganizationMembershipStatus literal
This exact same Literal["active", "inactive", "pending"] type alias is already defined in src/workos/types/user_management/organization_membership.py:7. Consider importing from a shared location or re-exporting from one module to the other to avoid the definitions drifting apart over time.
Description
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.